﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace P2PTransmit.Modal
{
    public class Connection: IComparable, IComparable<Connection>, IEquatable<Connection>
    {
        public override int GetHashCode()
        {
            return MachineMacAddress.GetHashCode();
        }

        public int CompareTo(object obj)
        {
            return MachineMacAddress.CompareTo( obj );
        }

        public string MachineName { get; set; }
        public string MachineMacAddress { get; set; }
        public string MachineIPAddress { get; set; }

        public override string ToString()
        {
            return MachineName;
        }


        public int CompareTo(Connection other)
        {
            return MachineMacAddress.CompareTo( other.MachineMacAddress );
        }

        public bool Equals(Connection other)
        {
            return other.MachineMacAddress == MachineMacAddress;
        }
    }
}
